package cn.cloud.all.security.access;

import cn.cloud.all.security.core.Authentication;

import java.util.Collection;

public interface AccessDecisionVoter<S> {

    int ACCESS_GRANTED = 1;
    int ACCESS_ABSTAIN = 0;
    int ACCESS_DENIED = -1;

    boolean supports(ConfigAttribute attribute);

    boolean supports(Class<?> clazz);

    int vote(Authentication authentication, S object, Collection<ConfigAttribute> attributes);
}
